<? if (!defined("BASEPATH")) exit("No direct script access allowed"); ?>

<?
$onsubmit = "
						if(!\$('#loginError').length)
						$.ajax({
							type: 'POST', 
							dataType: 'json',
							url: '".site_url()."forgot_password', 
							data: $('#frmForgotPassword').serialize(), 
							beforeSend: function(xhr) {
								$('#modal').mask('".$this->db->escape_str($this->lang->line("PLEASE_WAIT,_PROCESSING_IN_PROGRESS"))."');
							},
							success: function(data) {
								if(data.success) {
									\$('#modal').html(data.success);
									\$('#modal').addClass('alert_success');
								} else {
									d=document.createElement('div');
									d.id = 'loginError',
									\$(d).addClass('alert_error')
										.html('".$this->db->escape_str($this->lang->line("WRONG_USERNAME_OR_EMAIL"))."')
										.appendTo(\$('#modal')) 
										.click(function(){
											\$(this).remove();
										})
										.hide()
										.slideToggle(300)
										.delay(2500)
										.slideToggle(300)
										.queue(function() {
											\$(this).remove();
										});
								}
							},
							async: false
						}).always(function() {\$('#body').unmask();});
						return false;
						";
?>

<?=form_open("forgot_password", array("id" => "frmForgotPassword", "onsubmit" => $onsubmit))?>
	<h2><?=$this->lang->line("FORGOT_PASSWORD")?></h2>
	<?=form_input(array("name" => "usrEmail", "id" => "usrEmail", "tabindex" => 2, "class" => "form_data data w100", "style" => "width:590px; padding-right: 200px;", "value" => "")).form_input(array("class" => "inlinebutton", "style" => "margin-left: -200px;", "type" => "button", "value" => $this->lang->line("E-MAIL_ADDRESS")))?><br/><br/>
	<?=form_input(array("class" => "button w100", "tabindex" => 3, "type" => "submit", "value" => $this->lang->line("CREATE_NEW_PASSWORD")))?>
	<br/><br/>
<?=form_close()?>